package com.zwj.api.client;

import com.zwj.api.client.fallback.ItemClientFallback;
import com.zwj.api.config.DefaultFeignConfig;
import com.zwj.api.dto.ItemDTO;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.Collection;
import java.util.List;

/**
 * 商品服务Client
 *
 * @author 张文接
 * @version 1.0
 * @createTime 2024/7/14 22:30
 */
@FeignClient(value = "item-service", configuration = DefaultFeignConfig.class, fallbackFactory = ItemClientFallback.class)
public interface ItemClient {

    /**
     * 查询商品信息
     *
     * @param ids 商品id集合
     * @return 商品信息
     */
    @GetMapping("/items")
    List<ItemDTO> queryItemByIds(@RequestParam("ids") Collection<Long> ids);

}
